package pikes.peak;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;

import org.springframework.web.servlet.support.RequestContext;

public interface RequestProperty<T> {

	RequestProperty NULL_VALUE_PROVIDER = new RequestProperty<Object>() {

		public Object getValue(Map model, RequestContext requestContext) throws Exception {
			return null;
		}

	};

	RequestProperty EMPTY_COLLECTION = new RequestProperty<Collection>() {

		public Collection getValue(Map model, RequestContext requestContext) throws Exception {
			return Collections.EMPTY_LIST;
		}

	};

	T getValue(Map model, RequestContext requestContext) throws Exception;
}
